home *** CD-ROM | disk | FTP | other *** search
/ CICA 1995 August / CICA - The Ultimate Collection of Shareware for Windows (Disc 2) (August 1995).iso / disc2 / programr / atre27.exe / ATREE_27 / EXAMPLE3.LF < prev    next >
Text File  |  1992-08-01  |  4KB  |  130 lines

  1. #
  2. #
  3. #---- example3.lf
  4. #
  5. #
  6. #---- This is an lf example that learns the AND
  7. #---- function of two binary inputs.
  8. #---- The trees are saved into the file example3.tre
  9. #---- The encodings are saved into the file example3.cod
  10. #---- Note that a saved set of trees must be accompanied
  11. #---- by its corresponding encodings if the tree is to function
  12. #---- properly in future trials where the trees are loaded
  13. #---- instead of generated.
  14. #
  15.  
  16. #---- Specify tree statements.
  17. tree
  18.  
  19. #---- Train on trees of 512 leaves.
  20.     size = 512
  21.  
  22. #---- Use a majority vote of 3 trees to promote accuracy.
  23. #---- If your ALN's are not generalizing well, try increasing
  24. #---- the vote parameter from 1 to any odd number.  
  25. #---- Depending on the noisiness of your data, you may need to
  26. #---- set this all the way up to 31, but the usual number that works well
  27. #---- is 7.  In this example, the ALN's don't need votes to generalize the
  28. #---- pattern well.  The statement is here simply as an illustration.
  29.     vote = 3
  30.  
  31. #---- Train until we get 4 elements of the training set right
  32.     min correct  = 4
  33.  
  34. #---- or until 10 epochs have passed.
  35.     max epochs  = 10    
  36.  
  37. #---- Output the tree for later retrieval
  38. #---- We could also use "save folded tree to", but folded trees
  39. #---- may not re-train very well in the future.
  40.     save tree to "example3.tre"
  41.  
  42. #---- Specify function statements.
  43. function
  44.  
  45. #---- Domain dimension MUST be the first statement, followed
  46. #---- by the codomain dimension statement.
  47.     domain dimension = 2
  48.  
  49. #---- There is only 1 codimension.
  50.     codomain dimension = 1
  51.  
  52. #---- Coding output will be saved for use with the trees we are saving.
  53.     save coding to "example3.cod"
  54.  
  55. #---- All dimensions and codimensions are boolean, so specify
  56. #---- bits:stepsize for the encoding of input and output.
  57.     coding = 1:1 1:1 1:1 
  58.  
  59. #---- Boolean values have 2 quantization levels.
  60.     quantization = 2 2 2 
  61.  
  62. #---- Optional specifications of the largest values in the 5 encodings;
  63. #---- if not specified, then the largest value in the training and test set
  64. #---- is used.
  65.     largest = 1 1 1 
  66.  
  67. #---- Optional specifications of the smallest values in the 5 encodings;
  68. #---- if not specified, then the smallest value in the training and test set
  69. #---- is used.
  70. #---- Note that the smallest values may not equal the largest values.
  71.     smallest = 0 0 0
  72.  
  73. #---- There are four rows in our training set.
  74. training set size = 4
  75. training set =
  76.  
  77. # A B   A and B
  78.   1 1     1
  79.   1 0     0
  80.   0 1     0
  81.   0 0     0
  82.  
  83. #---- We will test on the following 4 vectors.
  84. test set size = 4
  85. test set =
  86.  
  87. # A B   A and B
  88.   1 1     1
  89.   1 0     0
  90.   0 1     0
  91.   0 0     0
  92.  
  93.  
  94. #---- The following output file should be generated:
  95. #---- The first line indicates how many codomains there are.
  96. #---- The next four lines represent each of the four lines in the test set.
  97. #---- Each value is followed by its corresponding quantization number
  98. #---- in the prescribed encoding scheme.  Each codomain is followed
  99. #---- by the corresponding result from the ALN's, along with its quantization 
  100. #---- number.  Remember, it's not the calculated value that is as important
  101. #---- as the calculated quantization level.  You can get more accurate values
  102. #---- by tightening up the encoding.
  103.  
  104. #---- After the results is the error histogram, which counts, 
  105. #---- for each of the codomains, the number of times the result quantization 
  106. #---- level differed from the actual quantization level by n.  In this example,
  107. #---- the ALN's executed the test set perfectly, so there are 4 counts for
  108. #---- errors of n = 0 in the codomain.
  109.  
  110. #  A            B        A and B    A and B result
  111.  
  112. #1
  113. #1.000000 1 1.000000 1  1.000000 1  1.000000 1
  114. #1.000000 1 0.000000 0  0.000000 0  0.000000 0
  115. #0.000000 0 1.000000 1  0.000000 0  0.000000 0
  116. #0.000000 0 0.000000 0  0.000000 0  0.000000 0
  117. #
  118. #ERROR HISTOGRAM
  119. #0 errors       4
  120. #1 errors       0
  121. #2 errors       0
  122. #3 errors       0
  123. #4 errors       0
  124. #5 errors       0
  125. #6 errors       0
  126. #7 errors       0
  127. #8 errors       0
  128. #9+ errors      0
  129.